package com.ruoyi.parkinglot.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.parkinglot.service.ParkAreaService;
import com.ruoyi.parkinglot.domain.ParkArea;
import com.ruoyi.parkinglot.mapper.ParkAreaMapper;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 区域管理Service业务层处理
 *
 * @author 31713
 * @date 2025-02-11
 */
@Service
public class ParkAreaServiceImpl extends ServiceImpl<ParkAreaMapper, ParkArea>
    implements ParkAreaService {

    /**
     * 根据区域ID查询区域信息
     *
     * @param areaId 区域ID
     * @return 区域信息
     */
    @Override
    public ParkArea getAreaById(Long areaId) {
        return this.getById(areaId);
    }
    /**
     * 获取所有区域列表
     */
    @Override
    public List<ParkArea> selectParkAreaList() {
        LambdaQueryWrapper<ParkArea> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(ParkArea::getDelFlag, "0")  // 未删除
                .eq(ParkArea::getStatus, "0")    // 假设 0 表示正常状态
                .orderByAsc(ParkArea::getAreaId);

        return baseMapper.selectList(queryWrapper);
    }
}




